Skip to content
Source
Sign inSign up
TanStack/schemas
Open History to see the last commit

sitemap[.]xml.ts

19 lines517 Bytes

1import { createFileRoute } from '@tanstack/react-router'
2import { env } from 'cloudflare:workers'
3​
4import { getDb } from '#/db/index.ts'
5import { sitemapXml } from '#/server/seo.ts'
6​
7export const Route = createFileRoute('/sitemap.xml')({
8 server: {
9 handlers: {
10 GET: async () =>
11 new Response(
12 await sitemapXml(getDb(env, { replica: true }), env.BETTER_AUTH_URL),
13 {
14 headers: { 'Content-Type': 'application/xml; charset=utf-8' },
15 },
16 ),
17 },
18 },
19})